<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>财务费用统计(按类型)-目的地运营集团数据管理平台</title>
<include file="Include:style" />
<link type="text/css" rel="stylesheet" href="__PUBLIC__/css/fullcalendar.css" />
<style>
	.schedule{ width: 100%;background-color: #f6f6f6}
	.thead-style th{font-size:12px;text-align: center; background: #232f3f; color: #fff; font-weight: normal;}
	.thead-style th span{ line-height: 20px; display: block; }
	.date span{ vertical-align: middle; }
	th.line{ padding: 0 !important; height: 41px; }
	th.line svg{ position: absolute; width: 100%; left: 0; top: 0; }
	th.line span{ position: absolute; bottom: 5px; left: 5px; }
	th.line em{ position: absolute; top: 0px; right: 5px; }
	.rel{ position: relative; height: 100% }
</style>
</head>
<body>
<include file="Include:header" />
<include file="Include:left" />
<div id="main">
	<div class="crumbs">
		<div class="crumbs-text">财务费用统计(按类型)</div>
		<div class="right">
			<div class="input-group left w250">
		    	<input type="text" id="keyword" value="{$keyword}" class="form-control" placeholder="按费用归属人搜索" autocomplete="off">
	    		<span class="input-group-btn">
	        		<button class="btn found_btn" type="button">搜索</button>
		    	</span>
		    </div>
		</div>
	</div>
	<div id="content">
		<div class="filter">
			<div class="filter-item">
				<div class="filter-title">申请类型：</div>
				<ul class="filter-order">
					<li <if condition="$type eq -10">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/-10/stage/{$stage}/start/{$start}/end/{$end}">全部</a>
					</li>
					<li <if condition="$type eq 1">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/1/stage/{$stage}/start/{$start}/end/{$end}">差旅费报销申请</a>
					</li>
					<li <if condition="$type eq 2">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/2/stage/{$stage}/start/{$start}/end/{$end}">费用报销单</a>
					</li>
					<li <if condition="$type eq 3">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/3/stage/{$stage}/start/{$start}/end/{$end}">付款申请</a>
					</li>
					<li <if condition="$type eq 4">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/4/stage/{$stage}/start/{$start}/end/{$end}">营销专项费用报销申请</a>
					</li>
					<li <if condition="$type eq 5">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/5/stage/{$stage}/start/{$start}/end/{$end}">营销专项付款申请</a>
					</li>
				</ul>
			</div>
			<if condition="$type eq 3">
			<div class="filter-item">
				<div class="filter-title">付款类型：</div>
				<ul class="filter-order">
					<li <if condition="$c_type eq -10">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/{$type}/c_type/-10/stage/{$stage}/start/{$start}/end/{$end}">全部</a>
					</li>
					<foreach name="cost_list" item="vo">
					<li <if condition="$c_type eq $vo['name1']">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/{$type}/c_type/{$vo['name1']}/stage/{$stage}/start/{$start}/end/{$end}">{$vo['name1']}</a>
					</li>
					</foreach>
				</ul>
			</div>
			</if>
			<div class="filter-item">
				<div class="filter-title">筛选方式：</div>
				<ul class="filter-order">
					<li <if condition="$stage eq 1">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/stage/1/start/{$start}/end/{$end}">按中心</a>
					</li>
					<li <if condition="$stage eq 2">class="current"</if>>
						<a href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/stage/2/start/{$start}/end/{$end}">按公司</a>
					</li>
				</ul>
			</div>
			<div class="filter-item">
				<div class="filter-title">周期筛选：</div>
				<ul class="filter-order">
					<a href="{$last_url}" class="mr10">上一周期</a>
					<input name="start" value="{$start}" type="text" class="form-control Wdate required-text w100" onclick="WdatePicker()" readonly autocomplete="off">
					-
					<input name="end" value="{$end}" type="text" class="form-control Wdate required-text w100" onclick="WdatePicker()" readonly autocomplete="off">
					<button class="btn btndate ml10" type="button">搜索</button>
					<span class='error-item'>开始日期必须小于结束日期</span>
					<a href="{$next_url}" class="ml10">下一周期</a>
				</ul>
			</div>
		</div>
		<div class="table-scrollx schedule">
			<if condition="$type eq -10">
            <table class="table table-bordered table-hover">
                <tbody>
                <tr class="thead-style text-center">
                    <th class="line" width="120"><div class="rel"><span><if condition="$stage eq 1">所属中心<else />所属公司</if></span><em>申请类型</em>
                        <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><line x1="0" y1="0" x2="100%" y2="100%" stroke="white" stroke-width="1"/></svg></div>
                    </th>
                    <th width="15%">差旅费报销申请</th>
					<th width="15%">费用报销单</th>
					<th width="15%">付款申请</th>
					<th width="15%">营销专项费用报销申请</th>
					<th width="15%">营销专项付款申请</th>
					<th width="15%">合计</th>
                </tr>
                <if condition="$result eq NULL">
					<tr>
                        <td colspan="8" class="text-center">暂无相关内容</td>
                    </tr>
				</if>
                <foreach name="result" id="key" item="vo">
                    <tr>
						<if condition="$stage eq 1">
							<td>{$vo['first_name']}</td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/1/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][1][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/2/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][2][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/3/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][3][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/4/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][4][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/5/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][5][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/start/{$start}/end/{$end}" target="_blank">{$vo['sum']}</a></td>
						<else />
							<td>{$vo['ascription_unit']}</td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/1/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][1][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/2/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][2][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/3/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][3][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/4/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][4][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/5/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$vo['detail'][5][total]}</a></td>
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/start/{$start}/end/{$end}" target="_blank">{$vo['sum']}</a></td>
						</if>
                    </tr>
                </foreach>
				<tr>
					<td><strong>总计</strong></td>
					<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/1/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$sum1?$sum1:NULL}</a></td>
					<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/2/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$sum2?$sum2:NULL}</a></td>
					<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/3/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$sum3?$sum3:NULL}</a></td>
					<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/4/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$sum4?$sum4:NULL}</a></td>
					<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/5/c_type/{$c_type}/start/{$start}/end/{$end}" target="_blank">{$sum5?$sum5:NULL}</a></td>
					<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/start/{$start}/end/{$end}" target="_blank">{$sum6?$sum6:NULL}</a></td>
				</tr>
                </tbody>
            </table>
			<elseif condition="$type eq 1" />
			<table class="table table-bordered table-hover">
				<tbody>
					<tr class="thead-style text-center">
						<th class="line" width="120"><div class="rel"><span><if condition="$stage eq 1">所属中心<else />所属公司</if></span><em>费用类型</em>
							<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><line x1="0" y1="0" x2="100%" y2="100%" stroke="white" stroke-width="1"/></svg></div>
						</th>
						<foreach name="fcost_list" item="fo">
							<th width="">{$fo['name1']}</th>
						</foreach>
						<th>合计</th>
					</tr>
					<if condition="$result eq NULL">
						<tr>
							<td colspan="{$cocsum}" class="text-center">暂无相关内容</td>
						</tr>
					</if>
					<foreach name="result" id="key" item="vo">
						<tr>
							<if condition="$stage eq 1">
								<td>{$vo['first_name']}</td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/住宿费/start/{$start}/end/{$end}" target="_blank">{$vo[other2]?$vo[other2]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/交通费/start/{$start}/end/{$end}" target="_blank">{$vo[other3]?$vo[other3]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/餐费/start/{$start}/end/{$end}" target="_blank">{$vo[other4]?$vo[other4]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/津贴/start/{$start}/end/{$end}" target="_blank">{$vo[other5]?$vo[other5]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/其它/start/{$start}/end/{$end}" target="_blank">{$vo[other6]?$vo[other6]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/-10/start/{$start}/end/{$end}" target="_blank">{$vo[sum]?$vo[sum]:NULL}</a></td>
							<else />
								<td>{$vo['ascription_unit']}</td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/住宿费/start/{$start}/end/{$end}" target="_blank">{$vo[other2]?$vo[other2]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/交通费/start/{$start}/end/{$end}" target="_blank">{$vo[other3]?$vo[other3]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/餐费/start/{$start}/end/{$end}" target="_blank">{$vo[other4]?$vo[other4]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/津贴/start/{$start}/end/{$end}" target="_blank">{$vo[other5]?$vo[other5]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/其它/start/{$start}/end/{$end}" target="_blank">{$vo[other6]?$vo[other6]:NULL}</a></td>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/-10/start/{$start}/end/{$end}" target="_blank">{$vo[sum]?$vo[sum]:NULL}</a></td>
							</if>
						</tr>
					</foreach>
					<tr>
						<td><strong>总计</strong></td>
						<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/住宿费/start/{$start}/end/{$end}" target="_blank">{$sum1?$sum1:NULL}</a></td>
						<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/交通费/start/{$start}/end/{$end}" target="_blank">{$sum2?$sum2:NULL}</a></td>
						<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/餐费/start/{$start}/end/{$end}" target="_blank">{$sum3?$sum3:NULL}</a></td>
						<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/津贴/start/{$start}/end/{$end}" target="_blank">{$sum4?$sum4:NULL}</a></td>
						<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/其它/start/{$start}/end/{$end}" target="_blank">{$sum5?$sum5:NULL}</a></td>
						<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/{$type}/start/{$start}/end/{$end}" target="_blank">{$sum6?$sum6:NULL}</a></td>
					</tr>
				</tbody>
			</table>
			<else/>
			<table class="table table-bordered table-hover">
				<tbody>
					<tr class="thead-style text-center">
						<th class="line" style="max-width:140px;min-width:120px" width="140"><div class="rel"><span><if condition="$stage eq 1">所属中心<else />所属公司</if></span><em>费用类型</em>
							<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><line x1="0" y1="0" x2="100%" y2="100%" stroke="white" stroke-width="1"/></svg></div>
						</th>
						<foreach name="fcost_list" item="fo">
							<th width="" style="white-space:nowrap">{$fo['name1']}</th>
						</foreach>
						<th width="100px">合计</th>
					</tr>
					<if condition="$result eq NULL">
						<tr>
							<td colspan="{$cocsum}" class="text-center">暂无相关内容</td>
						</tr>
					</if>
					<foreach name="result" id="key" item="vo">
						<if condition="$stage eq 1">
							<tr>
								<td>{$vo['first_name']}</td>
								<foreach name="vo['fcost_list']" item="fo">
									<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/{$fo['name1']}/start/{$start}/end/{$end}" target="_blank">{$fo[total]?$fo[total]:NULL}</a></td>
								</foreach>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/-10/start/{$start}/end/{$end}" target="_blank">{$vo[sum]?$vo[sum]:NULL}</a></td>
							</tr>
						<else />
							<tr>
								<td>{$vo['ascription_unit']}</td>
								<foreach name="vo['fcost_list']" item="fo">
									<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/{$fo['name1']}/start/{$start}/end/{$end}" target="_blank">{$fo[total]?$fo[total]:NULL}</a></td>
								</foreach>
								<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/-10/start/{$start}/end/{$end}" target="_blank">{$vo[sum]?$vo[sum]:NULL}</a></td>
							</tr>
						</if>
					</foreach>
					<tr>
						<td><strong>总计</strong></td>
						<foreach name="fcost_list" item="fos">
							<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/{$fos['name1']}/start/{$start}/end/{$end}" target="_blank">{$fos['sum']?$fos['sum']:NULL}</a></td>
						</foreach>
						<td><a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/{$type}/start/{$start}/end/{$end}" target="_blank">{$sum?$sum:NULL}</a></td>
					</tr>
				</tbody>
			</table>
			</if>
        </div>
	</div>
</div>
<include file="Include:javascript" />
<script type="text/javascript">
$(function(){
	//搜索
	$(".found_btn").keywordSearch("__APP__/Financial/cost_total_type/keyword/$keyword/company/{$company}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/{$stage}/start/{$start}/end/{$end}");
	//日期筛选
	$(".btndate").click(function(){
		var start = $("[name=start]").val(),
			end = $("[name=end]").val();
		if(Date.parse(end)>=Date.parse(start)){
			window.location.href = "__APP__/Financial/cost_total_type/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/stage/{$stage}/start/"+start+"/end/"+end;
		}else{
			$(this).nextAll(".error-item").show();
		}
	});
	$(document).on("change","[name='empl_id']",function(){
		var val = $(this).val();
		window.location.href="__APP__/Financial/cost_total_type/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/empl_id/"+val+"/stage/{$stage}/start/{$start}/end/{$end}";
	});
});
</script>
</body>
</html>